﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:UIDesigner="clr-namespace:Dynamic_UI_Framework">
    <!--  DragThumb Default Template  -->
    <Style TargetType="{x:Type UIDesigner:DragThumb}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type UIDesigner:DragThumb}">
                    <Rectangle Fill="Transparent" />
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>


    <!--  DesignerItem Style  -->
    <Style TargetType="{x:Type UIDesigner:DesignerItemControl}">
        <Setter Property="MinWidth" Value="25" />
        <Setter Property="MinHeight" Value="25" />
        <Setter Property="SnapsToDevicePixels" Value="True" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type UIDesigner:DesignerItemControl}">
                    <Border Name="outBorder" Background="White">
                        <Border Name="innerBorder" BorderThickness="0">
                            <Grid DataContext="{Binding RelativeSource={RelativeSource TemplatedParent}}">
                                <!--  PART_DragThumb  -->
                                <UIDesigner:DragThumb x:Name="PART_DragThumb" Cursor="SizeAll" />
                                <!--  PART_ContentPresenter  -->
                                <ContentPresenter x:Name="PART_ContentPresenter"
                                                  Margin="{TemplateBinding ContentControl.Padding}"
                                                  HorizontalAlignment="Stretch"
                                                  VerticalAlignment="Stretch"
                                                  Content="{TemplateBinding ContentControl.Content}" />
                            </Grid>
                        </Border>
                    </Border>
                    <ControlTemplate.Triggers>
                        <MultiDataTrigger>
                            <MultiDataTrigger.Conditions>
                                <Condition Binding="{Binding RelativeSource={RelativeSource Self}, Path=IsInDesignMode}" Value="True" />
                                <Condition Binding="{Binding RelativeSource={RelativeSource Self}, Path=IsMouseOver}" Value="True" />
                            </MultiDataTrigger.Conditions>
                            <Setter TargetName="innerBorder" Property="BorderThickness" Value="1" />
                            <Setter TargetName="outBorder" Property="Background" Value="Red" />
                        </MultiDataTrigger>
                        <DataTrigger Binding="{Binding RelativeSource={RelativeSource Self}, Path=IsSelected}" Value="True">
                            <Setter TargetName="innerBorder" Property="BorderThickness" Value="4" />
                            <Setter TargetName="outBorder" Property="Background" Value="#FFB9C6D4" />
                        </DataTrigger>
                    </ControlTemplate.Triggers>

                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>